//
//  IPTabBarController.swift
//  IPlan
//
//  Created by robot on 3/19/16.
//  Copyright © 2016 codeFighter.com. All rights reserved.
//

import UIKit

class IPTabBarController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        self.tabBar.backgroundImage = UIImage(named: "tabBar_bg")
        self.tabBar.tintColor = UIColor.white
        // Do any additional setup after loading the view.
    }
    
    func addChildViewController(_ childController: UIViewController,andTitle title:String, defaultImage:String, selectedImageName:String){
        addChildViewController(childController)
        let defaultImage = UIImage(named:defaultImage)
        let selectedImage = UIImage(named:selectedImageName)
        
        let viewController = childController.childViewControllers[0]
        viewController.tabBarItem = UITabBarItem.init(title: title, image:defaultImage, selectedImage: selectedImage)
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
